﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    /// <summary>
    /// 通知用户记录表，非私有信息只有在用户点击已读后才会生成记录
    /// </summary>
    [Table("SysNotifyUser")]
    public class SysNotifyUser
    {
        /// <summary>
        /// 创建日期
        /// </summary>
        [Required]
        [Column(TypeName = "timestamp(0)")]
        public DateTime CreatedDate { get; set; }

        /// <summary>
        /// 已读日期
        /// </summary>
        [Column(TypeName = "timestamp(0)")]
        public DateTime ReadedDate { get; set; }

        /// <summary>
        /// 用户Id
        /// </summary>
        [Required]
        [Column(TypeName = "uuid")]
        public Guid UserId { get; set; }

        /// <summary>
        /// 通知消息Id
        /// </summary>
        [Required]
        [Column(TypeName = "uuid")]
        public Guid NotificationId { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        [Column(TypeName = "bool")]
        public bool IsReaded { get; set; } = true;

        /// <summary>
        /// 是否已过期
        /// </summary>
        [Column(TypeName = "bool")]
        public bool IsExpired { get; set; } = false;

        public virtual SysNotification Notification { get; set; }
    }
}
